04. Quiz: Writing Unit Tests
SOLUTION:
- They help document the behavior of our code.
- They let us know if future changes break the functionality of our application.
QUIZ QUESTION::
Match each type of Assertion with its behavior.
ANSWER CHOICES:
|
Behavior |
Assertion |
|---|---|
Fails if two values are not the same |
|
Fails if any element in a |
|
Always fails |
|
Fails if the specified exception is not thrown |
|
Fails if the provided value is true |
SOLUTION:
|
Behavior |
Assertion |
|---|---|
|
Fails if any element in a |
|
|
Fails if the provided value is true |
|
|
Fails if two values are not the same |
|
|
Fails if the specified exception is not thrown |
|
|
Always fails |